<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <LINK REL="SHORTCUT ICON" HREF="images/favicon.ico"/>
        <title><ui:insert name="title"></ui:insert></title>
    </h:head>

    <h:body>
        <p:layout fullPage="true">  

            <p:layoutUnit position="top" height="150" resizable="false" closable="false" collapsible="false">
                <table align="center">
                    <tr>
                        <td><p:graphicImage value="/images/android-header.gif"/></td>
                    </tr>
                </table>
            </p:layoutUnit>  

            <p:layoutUnit position="bottom" height="50" resizable="false" closable="false" collapsible="true"> 
                <table align="center">
                    <tr>
                        <td> © Copyright </td>
                    </tr>
                </table>
            </p:layoutUnit>  
            <p:layoutUnit position="left" width="350" resizable="false" closable="true" collapsible="true">  
                <ui:insert name="left" id="left"></ui:insert>
            </p:layoutUnit>  

            <p:layoutUnit position="right" width="350" resizable="false" closable="true" collapsible="true">  
                <ui:insert name="right"/>
            </p:layoutUnit>  

            <p:layoutUnit position="center" >
                <h:form>
                    <br/>
                    <br/>
                    <table align="left">
                        <tr>
                            <td style="height: 250px;" valign="center">
                                <p:menu type="tiered" maxHeight="180">  
                                    <p:submenu label="Upravljanje aplikacijama">  
                                        <p:menuitem value="Pregled" icon="ui-icon ui-icon-search" />
                                        <p:menuitem value="Upload" action="uploadApplication.xhtml?faces-redirect=true" icon="ui-icon ui-icon-disk" />  
                                        <p:menuitem value="Brisanje" icon="ui-icon ui-icon-close"/>  
                                    </p:submenu>
                                    <c:if test="#{homeManagedBean.currentUser.admin}">
                                    <p:separator/>
                                    <p:submenu label="Administrator">
                                        <p:menuitem value="Aplikacije za potvrdu  (#{adminManagedBean.apps.disabledApp.size()})" icon="ui-icon ui-icon-star"/>
                                        <p:menuitem value="Pregled aplikacija" icon="ui-icon ui-icon-search" action="allApplications.xhtml?faces-redirect=true"/>
                                        <p:menuitem value="#{adminManagedBean.valueForButton}" ajax="false" action="#{adminManagedBean.serverManager()}" icon="ui-icon ui-icon-wrench" />
                                    </p:submenu>
                                    </c:if>
                                    <p:separator/>
                                    <p:submenu label="#{homeManagedBean.currentUser}">
                                        <p:menuitem value="Moj profil" action="profile.xhtml?faces-redirect=true" icon="ui-icon ui-icon-person"/>
                                        <p:menuitem value="Kraj rada" ajax="false" action="#{loginManagedBean.logout(homeManagedBean.currentUser.username)}" icon="ui-icon ui-icon-power" />
                                    </p:submenu>
                                </p:menu>  
                            </td>
                        </tr>
                    </table>
                </h:form>
                <table align="center">
                    <tr>
                        <td valign="top">
                            <ui:insert name="center" id="bottom"></ui:insert>
                        </td>
                    </tr>
                </table>
            </p:layoutUnit>
        </p:layout>
    </h:body>

</html>
